<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <meta http-equiv='X-UA-Compatible' content='ie=edge'>
    <title>Document</title>
</head>

<body>
    <div id='app'>
        <input type="text" v-model="msg">
        {{msg}}
        <hr>
        <!-- 双向绑定的本质:使用了属性绑定和事件绑定 -->
        <input type="text" :value="msg" @input="change">
    </div>
    <script src='js/vue.js'></script>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                msg: '文字'
            },
            methods: {
                change() {
                    console.log(event.target.value);
                    this.msg = event.target.value
                }
            },
        })
    </script>
</body>

</html>